import { BaseData } from "../../framework/base/BaseData";
import { GameConfig } from "../config/Config";
class Data {
    currentId: number = 1;
}
export class GuideData extends BaseData {
    protected ecrypt: boolean = false;
    data: Data;
    gameKey: string = GameConfig.AppCacheName + "guide";
    /**必须比结束的id多1 */
    endId: number = 7;
    public createData(): Data {
        this.data = new Data();
        return this.data;
    }
    public getCurrentId(): number {
        return this.data.currentId;
    }
    public get currentId(): number {
        return this.data.currentId;
    }
    public setCurrentId(id: number) {
        this.data.currentId = id;
        this.saveData();
    }
    /**
     * 增加引导id 
     * @param isRecode 是否需要记录 默认记录到数据库
     */
    public addCurrentId(isRecode: boolean = true) {
        this.data.currentId += 1;
        if (isRecode) {
            this.saveData();
        }
    }

    /**新手引导是否已经完成 */
    public isGuideEnd(): boolean {
        if (this.data.currentId >= this.endId) {
            return true;
        }
        return false;
    }

}